From e57101211f6a452f9b1ae12fada699ad3f34e394 Mon Sep 17 00:00:00 2001 From: Juergen Gross Date: Thu, 28 Oct 2010 12:22:09 +0100 Subject: [PATCH] avoid numa placement of cpus with active cpupools When using cpupools don't pin vcpus to numa nodes as this might conflict with the cpupool definition. numa placement should be handled by cpupool configuration instead. Signed-off-by: Juergen Gross Signed-off-by: Ian Jackson --- tools/python/xen/xend/XendCPUPool.py | 5 +++++ tools/python/xen/xend/XendDomainInfo.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/python/xen/xend/XendCPUPool.py b/tools/python/xen/xend/XendCPUPool.py index 71a79e873f..d26cbd6068 100644 --- a/tools/python/xen/xend/XendCPUPool.py +++ b/tools/python/xen/xend/XendCPUPool.py @@ -883,6 +883,11 @@ class XendCPUPool(XendBase): lookup_pool = classmethod(lookup_pool) + def number_of_pools(cls): + return len(xc.cpupool_getinfo()) + + number_of_pools = classmethod(number_of_pools) + def _cpu_number_to_ref(cls, number): node = XendNode.instance() for cpu_ref in node.get_host_cpu_refs(): diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 4360ce2492..6c4b044478 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -2748,7 +2748,7 @@ class XendDomainInfo: return map(lambda x: x[0], sorted(enumerate(nodeload), key=lambda x:x[1])) info = xc.numainfo() - if info['max_node_index'] > 0: + if info['max_node_index'] > 0 and XendCPUPool.number_of_pools() < 2: node_memory_list = info['node_memfree'] node_to_cpu = [] for i in range(0, info['max_node_index'] + 1): -- 2.30.2